package org.itboys.store.entity;

import java.util.List;
import java.util.Map;

import org.itboys.mongodb.entity.BaseLongIdEntity;

import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Indexed;
import org.mongodb.morphia.annotations.NotSaved;
import org.mongodb.morphia.annotations.Transient;

/**
 * 商品分类
 * @author Chenjh
 *
 */
@Entity(value = "StoreProductCategory", noClassnameStored = true)
public class ProductCategory extends BaseLongIdEntity{

	private static final long serialVersionUID = -1063019055496454795L;

	@Indexed
	private Long sellerId;//卖家id   0表示平台  大于0是卖家的店铺id

	@Indexed
	private String name; //分类名称
	
	@Indexed
	private Long parentId = 0L;//父分类ID
	
	@Indexed
	private String fullIdPath;//ID全路径
	
	private String fullNamePath;//名称全路径
	
	private int level;//所在层级
	
	private String image; //图片 如果哥哥地方 长宽比都是一样的 就用这个
	
	private String logo; //分类小logo

	private Long sort;//排序
	
	/**
	  * 各种单图的map key 为图片类型 自己定义常量
	  * 比如 0:app主图 1:微信主图 2:列表横图 等待 自己去定义
	  */
	private Map<Integer,String> imageMap;
	
	private int type = 0;//预留字段 可能以后有非建材商品分类 
	
	private int status = 1;//状态 1:有效 0:废弃
	
	private boolean leaf;//是否叶子节点  只有叶子节点才能挂产品
	
	private int isDeleted = 0;

	private String desc;//描述

	//一下是非持久化字段
	@NotSaved
	private Long _parentId = 0L;
	@Transient
	private List<Product> products;//分类下的产品
	
	public String getName() {
		return name;
	}

	public Long get_parentId() {
		return _parentId;
	}

	public void set_parentId(Long _parentId) {
		this._parentId = _parentId;
	}

	public int getIsDeleted() {
		return isDeleted;
	}

	public void setIsDeleted(int isDeleted) {
		this.isDeleted = isDeleted;
	}

	public boolean isLeaf() {
		return leaf;
	}

	public void setLeaf(boolean leaf) {
		this.leaf = leaf;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public String getFullIdPath() {
		return fullIdPath;
	}

	public void setFullIdPath(String fullIdPath) {
		this.fullIdPath = fullIdPath;
	}

	public String getFullNamePath() {
		return fullNamePath;
	}

	public void setFullNamePath(String fullNamePath) {
		this.fullNamePath = fullNamePath;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public Map<Integer, String> getImageMap() {
		return imageMap;
	}

	public void setImageMap(Map<Integer, String> imageMap) {
		this.imageMap = imageMap;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}
	
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public Long getSort() {
		return sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}

	public Long getSellerId() {
		return sellerId;
	}

	public void setSellerId(Long sellerId) {
		this.sellerId = sellerId;
	}

	public List<Product> getProducts() {
		return products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
